package com.liu.algorithm.strategy;

import java.util.Comparator;

/**
 * @author LIU
 * @version 1.0
 * @description: TODO
 * @date 2022/8/25 14:18
 */
public class CatHeightComparator implements Comparator<Cat> {

    @Override
    public int compare(Cat o1, Cat o2) {
        if (o1.getHeight() > o2.getHeight()) return 1;
        else if (o1.getHeight() < o2.getHeight()) return -1;
        else return 0;
//        return Integer.compare(o1.getHeight(), o2.getHeight());
    }
}
